Optimal. Leaf size=301 \[ -\frac {\left (\frac {9}{16}-\frac {5 i}{16}\right ) \tan ^{-1}\left (1-\frac {\sqrt {2} \sqrt {d \tan (e+f x)}}{\sqrt {d}}\right )}{\sqrt {2} a^2 \sqrt {d} f}+\frac {\left (\frac {9}{16}-\frac {5 i}{16}\right ) \tan ^{-1}\left (\frac {\sqrt {2} \sqrt {d \tan (e+f x)}}{\sqrt {d}}+1\right )}{\sqrt {2} a^2 \sqrt {d} f}+\frac {5 \sqrt {d \tan (e+f x)}}{8 a^2 d f (1+i \tan (e+f x))}-\frac {\left (\frac {9}{32}+\frac {5 i}{32}\right ) \log \left (\sqrt {d} \tan (e+f x)-\sqrt {2} \sqrt {d \tan (e+f x)}+\sqrt {d}\right )}{\sqrt {2} a^2 \sqrt {d} f}+\frac {\left (\frac {9}{32}+\frac {5 i}{32}\right ) \log \left (\sqrt {d} \tan (e+f x)+\sqrt {2} \sqrt {d \tan (e+f x)}+\sqrt {d}\right )}{\sqrt {2} a^2 \sqrt {d} f}+\frac {\sqrt {d \tan (e+f x)}}{4 d f (a+i a \tan (e+f x))^2} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.41, antiderivative size = 301, normalized size of antiderivative = 1.00, number of steps used = 12, number of rules used = 9, integrand size = 28, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.321, Rules used = {3559, 3596, 3534, 1168, 1162, 617, 204, 1165, 628} \[ -\frac {\left (\frac {9}{16}-\frac {5 i}{16}\right ) \tan ^{-1}\left (1-\frac {\sqrt {2} \sqrt {d \tan (e+f x)}}{\sqrt {d}}\right )}{\sqrt {2} a^2 \sqrt {d} f}+\frac {\left (\frac {9}{16}-\frac {5 i}{16}\right ) \tan ^{-1}\left (\frac {\sqrt {2} \sqrt {d \tan (e+f x)}}{\sqrt {d}}+1\right )}{\sqrt {2} a^2 \sqrt {d} f}+\frac {5 \sqrt {d \tan (e+f x)}}{8 a^2 d f (1+i \tan (e+f x))}-\frac {\left (\frac {9}{32}+\frac {5 i}{32}\right ) \log \left (\sqrt {d} \tan (e+f x)-\sqrt {2} \sqrt {d \tan (e+f x)}+\sqrt {d}\right )}{\sqrt {2} a^2 \sqrt {d} f}+\frac {\left (\frac {9}{32}+\frac {5 i}{32}\right ) \log \left (\sqrt {d} \tan (e+f x)+\sqrt {2} \sqrt {d \tan (e+f x)}+\sqrt {d}\right )}{\sqrt {2} a^2 \sqrt {d} f}+\frac {\sqrt {d \tan (e+f x)}}{4 d f (a+i a \tan (e+f x))^2} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 204
Rule 617
Rule 628
Rule 1162
Rule 1165
Rule 1168
Rule 3534
Rule 3559
Rule 3596
Rubi steps
\begin {align*} \int \frac {1}{\sqrt {d \tan (e+f x)} (a+i a \tan (e+f x))^2} \, dx &=\frac {\sqrt {d \tan (e+f x)}}{4 d f (a+i a \tan (e+f x))^2}+\frac {\int \frac {\frac {7 a d}{2}-\frac {3}{2} i a d \tan (e+f x)}{\sqrt {d \tan (e+f x)} (a+i a \tan (e+f x))} \, dx}{4 a^2 d}\\ &=\frac {5 \sqrt {d \tan (e+f x)}}{8 a^2 d f (1+i \tan (e+f x))}+\frac {\sqrt {d \tan (e+f x)}}{4 d f (a+i a \tan (e+f x))^2}+\frac {\int \frac {\frac {9 a^2 d^2}{2}-\frac {5}{2} i a^2 d^2 \tan (e+f x)}{\sqrt {d \tan (e+f x)}} \, dx}{8 a^4 d^2}\\ &=\frac {5 \sqrt {d \tan (e+f x)}}{8 a^2 d f (1+i \tan (e+f x))}+\frac {\sqrt {d \tan (e+f x)}}{4 d f (a+i a \tan (e+f x))^2}+\frac {\operatorname {Subst}\left (\int \frac {\frac {9 a^2 d^3}{2}-\frac {5}{2} i a^2 d^2 x^2}{d^2+x^4} \, dx,x,\sqrt {d \tan (e+f x)}\right )}{4 a^4 d^2 f}\\ &=\frac {5 \sqrt {d \tan (e+f x)}}{8 a^2 d f (1+i \tan (e+f x))}+\frac {\sqrt {d \tan (e+f x)}}{4 d f (a+i a \tan (e+f x))^2}+\frac {\left (\frac {9}{16}-\frac {5 i}{16}\right ) \operatorname {Subst}\left (\int \frac {d+x^2}{d^2+x^4} \, dx,x,\sqrt {d \tan (e+f x)}\right )}{a^2 f}+\frac {\left (\frac {9}{16}+\frac {5 i}{16}\right ) \operatorname {Subst}\left (\int \frac {d-x^2}{d^2+x^4} \, dx,x,\sqrt {d \tan (e+f x)}\right )}{a^2 f}\\ &=\frac {5 \sqrt {d \tan (e+f x)}}{8 a^2 d f (1+i \tan (e+f x))}+\frac {\sqrt {d \tan (e+f x)}}{4 d f (a+i a \tan (e+f x))^2}+\frac {\left (\frac {9}{32}-\frac {5 i}{32}\right ) \operatorname {Subst}\left (\int \frac {1}{d-\sqrt {2} \sqrt {d} x+x^2} \, dx,x,\sqrt {d \tan (e+f x)}\right )}{a^2 f}+\frac {\left (\frac {9}{32}-\frac {5 i}{32}\right ) \operatorname {Subst}\left (\int \frac {1}{d+\sqrt {2} \sqrt {d} x+x^2} \, dx,x,\sqrt {d \tan (e+f x)}\right )}{a^2 f}+-\frac {\left (\frac {9}{32}+\frac {5 i}{32}\right ) \operatorname {Subst}\left (\int \frac {\sqrt {2} \sqrt {d}+2 x}{-d-\sqrt {2} \sqrt {d} x-x^2} \, dx,x,\sqrt {d \tan (e+f x)}\right )}{\sqrt {2} a^2 \sqrt {d} f}+-\frac {\left (\frac {9}{32}+\frac {5 i}{32}\right ) \operatorname {Subst}\left (\int \frac {\sqrt {2} \sqrt {d}-2 x}{-d+\sqrt {2} \sqrt {d} x-x^2} \, dx,x,\sqrt {d \tan (e+f x)}\right )}{\sqrt {2} a^2 \sqrt {d} f}\\ &=-\frac {\left (\frac {9}{32}+\frac {5 i}{32}\right ) \log \left (\sqrt {d}+\sqrt {d} \tan (e+f x)-\sqrt {2} \sqrt {d \tan (e+f x)}\right )}{\sqrt {2} a^2 \sqrt {d} f}+\frac {\left (\frac {9}{32}+\frac {5 i}{32}\right ) \log \left (\sqrt {d}+\sqrt {d} \tan (e+f x)+\sqrt {2} \sqrt {d \tan (e+f x)}\right )}{\sqrt {2} a^2 \sqrt {d} f}+\frac {5 \sqrt {d \tan (e+f x)}}{8 a^2 d f (1+i \tan (e+f x))}+\frac {\sqrt {d \tan (e+f x)}}{4 d f (a+i a \tan (e+f x))^2}+-\frac {\left (\frac {9}{16}-\frac {5 i}{16}\right ) \operatorname {Subst}\left (\int \frac {1}{-1-x^2} \, dx,x,1+\frac {\sqrt {2} \sqrt {d \tan (e+f x)}}{\sqrt {d}}\right )}{\sqrt {2} a^2 \sqrt {d} f}+\frac {\left (\frac {9}{16}-\frac {5 i}{16}\right ) \operatorname {Subst}\left (\int \frac {1}{-1-x^2} \, dx,x,1-\frac {\sqrt {2} \sqrt {d \tan (e+f x)}}{\sqrt {d}}\right )}{\sqrt {2} a^2 \sqrt {d} f}\\ &=-\frac {\left (\frac {9}{16}-\frac {5 i}{16}\right ) \tan ^{-1}\left (1-\frac {\sqrt {2} \sqrt {d \tan (e+f x)}}{\sqrt {d}}\right )}{\sqrt {2} a^2 \sqrt {d} f}+\frac {\left (\frac {9}{16}-\frac {5 i}{16}\right ) \tan ^{-1}\left (1+\frac {\sqrt {2} \sqrt {d \tan (e+f x)}}{\sqrt {d}}\right )}{\sqrt {2} a^2 \sqrt {d} f}-\frac {\left (\frac {9}{32}+\frac {5 i}{32}\right ) \log \left (\sqrt {d}+\sqrt {d} \tan (e+f x)-\sqrt {2} \sqrt {d \tan (e+f x)}\right )}{\sqrt {2} a^2 \sqrt {d} f}+\frac {\left (\frac {9}{32}+\frac {5 i}{32}\right ) \log \left (\sqrt {d}+\sqrt {d} \tan (e+f x)+\sqrt {2} \sqrt {d \tan (e+f x)}\right )}{\sqrt {2} a^2 \sqrt {d} f}+\frac {5 \sqrt {d \tan (e+f x)}}{8 a^2 d f (1+i \tan (e+f x))}+\frac {\sqrt {d \tan (e+f x)}}{4 d f (a+i a \tan (e+f x))^2}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 1.07, size = 228, normalized size = 0.76 \[ \frac {\sec ^3(e+f x) \left (-7 \sin (e+f x)-7 \sin (3 (e+f x))-5 i \cos (e+f x)+5 i \cos (3 (e+f x))+(5+9 i) \sqrt {\sin (2 (e+f x))} \sin ^{-1}(\cos (e+f x)-\sin (e+f x)) (\sin (2 (e+f x))-i \cos (2 (e+f x)))+(5-9 i) \sin ^{\frac {3}{2}}(2 (e+f x)) \log \left (\sin (e+f x)+\sqrt {\sin (2 (e+f x))}+\cos (e+f x)\right )-(9+5 i) \sqrt {\sin (2 (e+f x))} \cos (2 (e+f x)) \log \left (\sin (e+f x)+\sqrt {\sin (2 (e+f x))}+\cos (e+f x)\right )\right )}{32 a^2 f (\tan (e+f x)-i)^2 \sqrt {d \tan (e+f x)}} \]
Warning: Unable to verify antiderivative.
[In]
[Out]
________________________________________________________________________________________
fricas [B] time = 0.73, size = 556, normalized size = 1.85 \[ -\frac {{\left (4 \, a^{2} d f \sqrt {-\frac {i}{16 \, a^{4} d f^{2}}} e^{\left (4 i \, f x + 4 i \, e\right )} \log \left (-{\left (8 \, {\left (a^{2} d f e^{\left (2 i \, f x + 2 i \, e\right )} + a^{2} d f\right )} \sqrt {\frac {-i \, d e^{\left (2 i \, f x + 2 i \, e\right )} + i \, d}{e^{\left (2 i \, f x + 2 i \, e\right )} + 1}} \sqrt {-\frac {i}{16 \, a^{4} d f^{2}}} + 2 i \, d e^{\left (2 i \, f x + 2 i \, e\right )}\right )} e^{\left (-2 i \, f x - 2 i \, e\right )}\right ) - 4 \, a^{2} d f \sqrt {-\frac {i}{16 \, a^{4} d f^{2}}} e^{\left (4 i \, f x + 4 i \, e\right )} \log \left ({\left (8 \, {\left (a^{2} d f e^{\left (2 i \, f x + 2 i \, e\right )} + a^{2} d f\right )} \sqrt {\frac {-i \, d e^{\left (2 i \, f x + 2 i \, e\right )} + i \, d}{e^{\left (2 i \, f x + 2 i \, e\right )} + 1}} \sqrt {-\frac {i}{16 \, a^{4} d f^{2}}} - 2 i \, d e^{\left (2 i \, f x + 2 i \, e\right )}\right )} e^{\left (-2 i \, f x - 2 i \, e\right )}\right ) - 4 \, a^{2} d f \sqrt {\frac {49 i}{64 \, a^{4} d f^{2}}} e^{\left (4 i \, f x + 4 i \, e\right )} \log \left (\frac {{\left (8 \, {\left (a^{2} f e^{\left (2 i \, f x + 2 i \, e\right )} + a^{2} f\right )} \sqrt {\frac {-i \, d e^{\left (2 i \, f x + 2 i \, e\right )} + i \, d}{e^{\left (2 i \, f x + 2 i \, e\right )} + 1}} \sqrt {\frac {49 i}{64 \, a^{4} d f^{2}}} + 7 i\right )} e^{\left (-2 i \, f x - 2 i \, e\right )}}{8 \, a^{2} f}\right ) + 4 \, a^{2} d f \sqrt {\frac {49 i}{64 \, a^{4} d f^{2}}} e^{\left (4 i \, f x + 4 i \, e\right )} \log \left (-\frac {{\left (8 \, {\left (a^{2} f e^{\left (2 i \, f x + 2 i \, e\right )} + a^{2} f\right )} \sqrt {\frac {-i \, d e^{\left (2 i \, f x + 2 i \, e\right )} + i \, d}{e^{\left (2 i \, f x + 2 i \, e\right )} + 1}} \sqrt {\frac {49 i}{64 \, a^{4} d f^{2}}} - 7 i\right )} e^{\left (-2 i \, f x - 2 i \, e\right )}}{8 \, a^{2} f}\right ) - \sqrt {\frac {-i \, d e^{\left (2 i \, f x + 2 i \, e\right )} + i \, d}{e^{\left (2 i \, f x + 2 i \, e\right )} + 1}} {\left (6 \, e^{\left (4 i \, f x + 4 i \, e\right )} + 7 \, e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right )}\right )} e^{\left (-4 i \, f x - 4 i \, e\right )}}{16 \, a^{2} d f} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 1.69, size = 198, normalized size = 0.66 \[ \frac {7 \, \sqrt {2} \arctan \left (\frac {16 i \, \sqrt {d^{2}} \sqrt {d \tan \left (f x + e\right )}}{8 i \, \sqrt {2} d^{\frac {3}{2}} + 8 \, \sqrt {2} \sqrt {d^{2}} \sqrt {d}}\right )}{8 \, a^{2} \sqrt {d} f {\left (\frac {i \, d}{\sqrt {d^{2}}} + 1\right )}} - \frac {\sqrt {2} \arctan \left (\frac {16 i \, \sqrt {d^{2}} \sqrt {d \tan \left (f x + e\right )}}{-8 i \, \sqrt {2} d^{\frac {3}{2}} + 8 \, \sqrt {2} \sqrt {d^{2}} \sqrt {d}}\right )}{4 \, a^{2} \sqrt {d} f {\left (-\frac {i \, d}{\sqrt {d^{2}}} + 1\right )}} + \frac {-5 i \, \sqrt {d \tan \left (f x + e\right )} d \tan \left (f x + e\right ) - 7 \, \sqrt {d \tan \left (f x + e\right )} d}{8 \, {\left (d \tan \left (f x + e\right ) - i \, d\right )}^{2} a^{2} f} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.33, size = 136, normalized size = 0.45 \[ -\frac {5 i \left (d \tan \left (f x +e \right )\right )^{\frac {3}{2}}}{8 f \,a^{2} \left (d \tan \left (f x +e \right )-i d \right )^{2}}-\frac {7 d \sqrt {d \tan \left (f x +e \right )}}{8 f \,a^{2} \left (d \tan \left (f x +e \right )-i d \right )^{2}}-\frac {7 i \arctan \left (\frac {\sqrt {d \tan \left (f x +e \right )}}{\sqrt {-i d}}\right )}{8 f \,a^{2} \sqrt {-i d}}+\frac {i \arctan \left (\frac {\sqrt {d \tan \left (f x +e \right )}}{\sqrt {i d}}\right )}{4 f \,a^{2} \sqrt {i d}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [F(-2)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: RuntimeError} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 5.48, size = 168, normalized size = 0.56 \[ \frac {\frac {7\,d\,\sqrt {d\,\mathrm {tan}\left (e+f\,x\right )}}{8\,a^2\,f}+\frac {{\left (d\,\mathrm {tan}\left (e+f\,x\right )\right )}^{3/2}\,5{}\mathrm {i}}{8\,a^2\,f}}{-d^2\,{\mathrm {tan}\left (e+f\,x\right )}^2+d^2\,\mathrm {tan}\left (e+f\,x\right )\,2{}\mathrm {i}+d^2}+\mathrm {atan}\left (8\,a^2\,f\,\sqrt {d\,\mathrm {tan}\left (e+f\,x\right )}\,\sqrt {-\frac {1{}\mathrm {i}}{64\,a^4\,d\,f^2}}\right )\,\sqrt {-\frac {1{}\mathrm {i}}{64\,a^4\,d\,f^2}}\,2{}\mathrm {i}-\mathrm {atan}\left (\frac {16\,a^2\,f\,\sqrt {d\,\mathrm {tan}\left (e+f\,x\right )}\,\sqrt {\frac {49{}\mathrm {i}}{256\,a^4\,d\,f^2}}}{7}\right )\,\sqrt {\frac {49{}\mathrm {i}}{256\,a^4\,d\,f^2}}\,2{}\mathrm {i} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ - \frac {\int \frac {1}{\sqrt {d \tan {\left (e + f x \right )}} \tan ^{2}{\left (e + f x \right )} - 2 i \sqrt {d \tan {\left (e + f x \right )}} \tan {\left (e + f x \right )} - \sqrt {d \tan {\left (e + f x \right )}}}\, dx}{a^{2}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________